using System;
using System.IO;
using UnityEngine;

namespace Voodoo.Distribution
{
	public static class PathHelper
	{
		private const string _assets = "Assets";

		private const string _companyName = "Voodoo";

		public static string ToolLocalPath(string toolName)
		{
			return Path.Combine("Voodoo", toolName);
		}

		public static string ToolAbsolutePath(string toolName)
		{
			return Path.Combine(Application.dataPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "Voodoo", toolName);
		}

		public static string ToolAssetPath(string toolName)
		{
			return Path.Combine("Assets", "Voodoo", toolName);
		}

		public static string ToLocalPath(this string absolutePath)
		{
			int num = absolutePath.IndexOf("Assets", StringComparison.Ordinal);
			if (num >= 0)
			{
				return absolutePath.Substring(num);
			}
			return absolutePath;
		}
	}
}
